<!doctype html>
<html>
	<head>
		<meta charset="utf-8"/>
		<title>
			订单确认页 － ZOL商城｜中关村在线旗下网上商城
		</title>
		<meta name="keywords" content=""/>
		<meta name="description" content=""/>
		<link href="./Public/other/css/orderPublic_v1.css" rel="stylesheet" type="text/css" />
		<link href="./Public/other/css/order_v1.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="./Public/other/js/jquery-1.8.1.js"></script>
		<script type="text/javascript" src="./Public/other/js/area.js"></script>
		<script type="text/javascript" src="./Public/other/js/userAddress.js"></script>
		<script type="text/javascript" src="./Public/other/js/func.js"></script>
		<style>/*提示 弹出层 prompt*/

.layerbox-head .layerbox-close,
.layerbox-button-true,
.layerbox-button-false,
.layerbox-body .wrong-tip {
	background: url(./Public/other/image/pop-ico.png) no-repeat;
}

.layerbox-border {
	position: fixed;
	top: 50%;
	left: 50%;
	width: 370px;
	height: 204px;
	margin: -107px 0 0 -190px;
	border: 5px solid #b2b2b2;
	z-index: 1001;
	display: none
}

.layerbox-content {
	background: #fff;
}

.layerbox-head {
	height: 37px;
	padding: 0 10px;
	line-height: 37px;
	border-bottom: 1px solid #e6e6e6;
	background: #f3f3f3;
	overflow: hidden;
	zoom: 1;
}

.layerbox-title {
	padding: 0 0 0 5px;
	font-size: 14px;
	line-height: 37px;
}

.layerbox-subtitle {
	font-size: 12px;
	color: #666;
	font-family: simsun;
	font-weight: normal;
}

.layerbox-head .layerbox-close {
	position: absolute;
	width: 21px;
	height: 21px;
	top: 8px;
	right: 10px;
	background-position: -90px 5px;
	cursor: pointer;
	_baclground-position: -120px -85px;
	overflow: hidden;
	font: 0/0 arial;
}

.layerbox-head .layerbox-close:hover {
	background-position: -90px -17px;
}

.layerbox-body {
	padding: 30px 16px 0;
	zoom: 1;
}

.layerbox-body p {
	font-size: 14px;
	line-height: 20px;
}

.layerbox-body p em {
	color: #36c;
}

.layerbox-body .layer-check {
	position: relative;
	height: 18px;
	margin: 9px 0 0;
	padding: 0 0 0 18px;
	color: #666;
}

.layerbox-body .layer-check input {
	position: absolute;
	top: 3px;
	left: 0;
	*top: 0;
	*left: -3px;
}

.layerbox-body .wrong-tip {
	visibility: hidden;
	height: 18px;
	margin: 2px 0 0;
	padding: 0 0 0 18px;
	color: #f00;
	background-position: -97px -47px;
}

.layerbox-button-true {
	display: inline-block;
	width: 80px;
	height: 30px;
	color: #fff;
	line-height: 30px;
	text-align: center;
	background-position: 0 0;
}

.layerbox-button-true:hover {
	background-position: 0 -35px;
	color: #fff;
	text-decoration: none;
}

.layerbox-button-false {
	display: inline-block;
	margin: 0 0 0 10px;
	width: 80px;
	height: 30px;
	color: #333;
	line-height: 30px;
	text-align: center;
	background-position: 0 -70px;
}

.layerbox-button-false:hover {
	color: #333;
	text-decoration: none;
	background-position: 0 -105px;
}

.layerbox-foot {
	padding: 15px 16px 20px;
	font-family: simsun;
	line-height: 28px;
}

.layerbox-foot .more-info {
	float: right;
}

.layerbox-footleft {
	text-align: left;
}</style>
	</head>
	<body>
		<!-- header -->
		<!-- header -->
		<div class="header clearfix">
			<!--logo样式 -->
			<div class="logo">
				<a href="#" title="中关村商城">
					<img src="./Public/other/image/shop_212x40.jpg" width="212" height="40">
					<img src="./Public/other/image/logo-text.png" width="165" height="40">
				</a>
			</div>
			<div class="flow-step">
				<ul class="flow-step-2">
					<li class="s1">
						加入购物车
					</li>
					<li class="s2">
						下订单
					</li>
					<li class="s3">
						去付款
					</li>
					<li class="s4">
						确认收货
					</li>
					<li class="s5">
						评价
					</li>
				</ul>
			</div>
		</div>
		<!-- //header --><!-- //header -->
		<div class="wrapper">
			<form action="" name="confirmOrder" id="confirmOrder" method="post">
				<input type="hidden" name="cartFrom" value=""/>
				<!-- 收货人信息 -->
				<div class="container consignee">
					<table>
						<tr>
							<td class="cell-1">
								收货人信息
							</td>
							<td class="cell-2">
								<ul class="address-list">
									<li class="current" id="list_647554" addliid="647554">
	                                    <label><input autocomplete='off' id="addressId_647554" onclick="$.changeAddress(this)" truename="赵蒙" provinceId="1" cityId="478" address="xiangyanogasd" mobile="15923432342" tel="" isDefault="0" name="addressId" type="radio" value="647554">
	                                        <span><strong><em>赵蒙</em></strong></span>  北京 朝阳区 xiangyanogasd  15923432342</label>
	                                    <div class="operate">
	                                        <a href="javascript:void(0)" onclick="$.updateAddressBox('647554')">编辑</a>
	                                        <a href="javascript:void(0)" onclick="$.deleteAddress('647554')">删除</a>
	                                    </div>                                
	                                </li> 
									<li class="add-edits ">
										  <label><input name="addressId" type="radio" value="" >添加新地址</label><div class="closeButton" style="display:block"><a href="#" class="closebtn" onclick="$.closeDeleteAddressBox()">关闭</a></div>                                <div class="infor-editor editBox " id="infor-editor">
                                    <dl>
												<dt>
													<em class="xh">*</em>收货人：
												</dt>
												<dd>
													<input name="truename" id="deliverName" type="text" value="" class="text recinput" maxlength="10">
													<span class="wrong-tips none" id="deliverNameTips">请填写收货人</span>
												</dd>
											</dl>
											<!--城市联动-->
										<script type="text/javascript">
											$(function(){
												//初始化方法
												area.init('area');
												//修改的时候默认被选中效果
												area.selected('请选择省','请选择市','请选择县');
											})
										</script>
											<dl class="area">
												<dt>
													<em class="xh">*</em>所在地区：
												</dt>
												<dd class="clearfix">
													<select name="sheng" id="area1"></select>
													<select name="shi" id="area2"></select>
													<select name="qu" id="area3"></select>
												</dd>
											</dl>
											<dl class="detailed-address">
												<dt>
													<em class="xh">*</em>详细地址：
												</dt>
												<dd>
													<input name="address" id="deliverAddress"  type="text" value="" class="text addinput" maxlength="30" placeholder="请填写详细地址，5~30字">
												</dd>
											</dl>
											<div class="number clearfix">
												<dl>
													<dt>
														<em class="xh">*</em>手机号码：
													</dt>
													<dd>
														<input name="moblie" id="deliverMobile" type="text" value="" class="text" maxlength="11">
													</dd>
												</dl>
											</div>
											<label class="setup-default">
												<input style="display: none;" name="deliverDefault" type="checkbox" class="" value="1">
												<input name="deliverDefault"  type="checkbox" class="checkbox" value="0">
												设置为默认地址</label>
										<!--保存地址ajax-->
										<script type="text/javascript">
											$(function(){
												$('#deliverBotton').click(function(){
													$.ajax({
														type:"post",
														url:"<?php echo U('addaddr')?>",
														data:{
															name:$('#deliverName').attr('value'),
															sheng:$('[name=sheng]').attr('value'),
															shi:$('[name=shi]').attr('value'),
															qu:$('[name=qu]').attr('value'),
															addr:$('#deliverAddress').attr('value'),
															tel:$('#deliverMobile').attr('value'),
															de:$('[name=deliverDefault]').attr('value'),
														},
														dataType:'json',
														success:function(php){
															 
														}
													});
													
												})
											})
										</script>
											<input addressId="0" id="deliverBotton" type="button" class="savebtn w120-btn" value="确认收货地址">
										</div>
								</ul>
								<div class="more-address none" id="addressShow">
									<a href="#" class="unfolds">
										更多常用地址
									</a>
								</div>
								<div class="more-address none" id="addressHide">
									<a href="#" class="fold">
										收起常用地址
									</a>
								</div>
								<div class="add-address none">
									<label>
										<input name="addAddress" type="radio" value="1" onclick="$.showAddressBox()">
										添加新地址（最多可添加10个地址,您还可以添加10个地址）</label>
								</div>
							</td>
						</tr>
					</table>
				</div>
				<!-- //收货人信息 -->
				<!-- 购物车商品信息 -->
				<input type="hidden" name="buyType" value="2"/>
				<input type="hidden" name="allCartIdStr" value="2240687"/>
				<div class="order-list order-current">
					<input type="hidden" name="cart-js-192062" value="2240687"/>
					<input type="hidden" name="fullMer_192062" value="540" fn="1451556546"/>
					<table>
						<tbody>
							<tr>
								<td class="cell-1">
									<label>
										<input name="merchantId" type="radio" invoice="0" value="192062" checked>
										商品订单1</label>
								</td>
								<td class="cell-2">
									<div class="offer-detail">
										<div class="total">
											<span class="type">满就送</span>
											商品金额已满
											<em>300.00</em>
											元，送您
											<em>1</em>
											件礼品
										</div>
										<ul class="lists">
											<li>
												[礼品1] 保护套+贴膜
											</li>
										</ul>
									</div>
									<table class="goods">
										<tbody>
											<tr>
												<th class="infor">
													商品信息
												</th>
												<th class="color-suits">
													颜色套装
												</th>
												<th class="saletype">
													销售类型
												</th>
												<th class="price">
													单价
												</th>
												<th class="agio">
													优惠
												</th>
												<th class="amount">
													数量
												</th>
												<th class="total">
													总价
												</th>
											</tr>
											<tr>
												<td class="infor">
													<a href="#" target="_blank" class="pic">
														<img width="60" height="60" src="./Public/other/image/ChMkJ1aA7pyISIfQAAM_MV2zml0AAGqZwFQHX4AAz9J149.jpg" alt="【顺丰包邮，送高清贴膜+软壳】魅族 魅蓝Note 2（双4G，支持移动联通4G网络）2GRAM  16GROM">
													</a>
													<h3 class="title">
														<a href="#" target="_blank">
															【顺丰包邮，送高清贴膜+软壳】魅族 魅蓝Note 2（双4G，支持移动联通4G网络）2GRAM  16GGROM
														</a>
													</h3>
												</td>
												<td class="color-suits">
													<div class="color">
														白色厂商指导价16GB
													</div>
													<div class="suits"  id="suit-details-5749869" fn="5749869">
														<span>官方标配</span>
														<div class="suit-details">
															<i class="ico">
															</i>
															<p>
																套装详情：
															</p>
															<p>
																主机 1 件  电源适配器 1 件  数据线 1 件  保修证书 1 件  SIM卡顶针 1 件
															</p>
														</div>
													</div>
												</td>
												<td class="saletype">
													-
												</td>
												<td class="price">
													&yen;813
												</td>
												<td>
													--
												</td>
												<td class="amount">
													1
												</td>
												<td class="total">
													&yen;813
												</td>
											</tr>
										</tbody>
									</table>
									<div class="order-foot clearfix">
										<div class="store-infor">
											<span class="name">店铺：
												<a href="#">
													蚂蚁之家专营店
												</a></span>
											<a class="tag-security">
												z保障+
											</a>
										</div>
										<div class="delivery">
											<div class="payment">
												<select name="payType-192062" onchange="$.changeShipping()" id="payType-192062">
													<option value="2" selected>
														网上支付
													</option>
												</select>
												<span>支付方式：</span>
											</div>
											<div class="express">
												<select name="shipping-192062" onchange="$.changeShipping()" id="shipping-192062">
													<option value="0" selected>
														无法配送到该地区：-元
													</option>
												</select>
												<span>到
													<em id="sendArea-192062">
														&nbsp;&nbsp;
													</em>配送方式：</span>
											</div>
										</div>
									</div>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
				<!-- //购物车商品信息 -->
				<!-- 订单发票 -->
				<div class="container consignee" id="order_invoice_div" style="display:none;">
					<table>
						<tbody>
							<tr>
								<td class="cell-1">
									发票
								</td>
								<td class="cell-2">
									<div class="invoice clearfix" id="invoice-show-div">
										<input type="hidden" name="isInvoice" id="is_invoice" value="0"/>
										<span id="invoice_type_name">
										</span>
										<span id="invoice_name_tips" class="invoice-tips">不需要发票</span>
										<a href="javascript:void(0)" id="invoice-editor" >
											修改
										</a>
									</div>
									<div class="infor-editor invoice-editor" id="invoice-editor-div">
										<dl>
											<dt>
												<em class="xh">*</em>发票类型：
											</dt>
											<dd>
												<label>
													<input name="invoiceType" type="radio" value="1" checked>
													普通发票</label>
											</dd>
										</dl>
										<dl>
											<dt>
												<em class="xh">*</em>发票抬头：
											</dt>
											<dd>
												<input name="invoiceName" type="text" value="姓名/公司名称" class="text text-color" maxlength="30">
												<span class="wrong-tips" id="invoice_error" style="display:none;">发票信息错误</span>
											</dd>
										</dl>
										<div class="btn clearfix">
											<input type="button" id="save_invoice_info" class="savebtn w120-btn" value="保存发票信息">
											<a href="javascript:void(0)" id="invoice_cancel" class="cancel">
												取消
											</a>
										</div>
									</div>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
				<!-- //订单发票 -->
				<!-- 订单备注 -->
				<div class="order-note">
					<table>
						<tr>
							<td class="cell-1">
								订单备注
							</td>
							<td class="cell-2">
								<textarea name="buyer-note-192062" id="orderNote" fn="limit" limit="200" tipsId="haveFonts"  onfocus="if(this.value=='您可以填写对商品、配送的要求...') this.value='';this.style.color='#333'" onblur="if(this.value=='') {this.value='您可以填写对商品、配送的要求...';this.style.color='#999999'}" style="color:#999999;">您可以填写对商品、配送的要求...</textarea>								<span><em id="haveFonts">0</em>/200</span>
							</td>
							<td class="cell-3">
								<ul class="total-price">
									<li>
										<span>商品总价：</span><em id="goods-total-price">&yen;813</em>
									</li>
									<li>
										<span>运费：</span><em id="goods-freight-price">&yen;-</em>
									</li>
									<li>
										<span>订单总计：</span><em class="total" id="total-price">&yen;813</em>
									</li>
								</ul>
							</td>
						</tr>
					</table>
				</div>
			</form>
			<!-- //订单备注 -->
			<!-- 提交订单 -->
			<div class="submit-order clearfix">
				<a href="#" class="submit-return">
					返回修改购物车
				</a>
				<input class="submit-btn" name="confirmOrder" type="button" onclick="$.orderCartSubmit()" value="提交订单">
				<div class="submit-loading" style="display:none;">
					提交中...
				</div>
				<div class="fail-submit" style='display:none;cursor: not-allowed' title='填写错误，不能提交订单'>
					不能提交订单
				</div>
			</div>
			<!-- //提交订单 -->
		</div>
		<!-- 公共底部 -->
		<div class="footer">
			<p class="links">
				<a target="_blank" href="#">
					关于商城
				</a>|
				<a target="_blank" href="#">
					营销中心
				</a>|
				<a target="_blank" href="#">
					服务中心
				</a>|
				<a target="_blank" href="#">
					联系我们
				</a>|
				<a target="_blank" href="#">
					发展历程
				</a>|
				<a target="_blank" href="#">
					媒体报道
				</a>
			</p>
			<p>
				<span class="copyright">&copy;
					<script type="text/javascript">var yearStr;
now = new Date();
yearStr = now.getFullYear();
document.write(yearStr);</script>中关村在线 版权所有. 京ICP备09041801号-182
					<a target="_blank" href="#">
						京ICP证010391号
					</a></span>
			</p>
		</div>
		</div><!-- //公共底部 -->
		<!-- 删除提示框 -->
		<div class="delete-tooltip-box" id="deleteBox" style="display:none;">
			<div class="delete-tooltip">
				<i class="close" onclick="$.closeDeleteAddressBox()">
				</i>
				<p>
					请问确认删除地址吗？
				</p>
				<div class="btn clearfix">
					<a href="javascript:void(0)" class="ack-btn">
						确认删除
					</a>
					<a href="javascript:void(0)" class="cancel-btn">
						取消
					</a>
				</div>
			</div>
		</div>
		<div class="delete-tooltip-box" id="order-submit-box" style="display:none;">
			<div class="delete-tooltip">
				<i class="close" onclick="$.closeDeleteAddressBox()">
				</i>
				<p>
					亲，有错误额！
				</p>
			</div>
		</div>
		<!-- //删除提示框 -->
		<!-- 全屏遮罩 -->
		<div class="layerbox-overlay" style=" display:none;">
		</div>
		<!-- //全屏遮罩 -->
		<div class="adjust-tooltip-box" id="merchantChangFullSellt" style="display:none;">
			<div class="adjust-tooltip djust-tooltip-2">
				<i class="close">
				</i>
				<h4>
					亲！由于商家调整优惠活动。
				</h4>
				<h4>
					请仔细核对您的优惠信息。
				</h4>
			</div>
		</div>
		<!-- 满减满赠不在区间提示 -->
		<div class="adjust-tooltip-box" id="noFullSellt" style="display:none;">
			<div class="adjust-tooltip djust-tooltip-2">
				<i class="close">
				</i>
				<h4>
					亲！由于商家调整优惠活动。
				</h4>
				<h4>
					您的订单将不享受优惠。
				</h4>
				<div class="btn clearfix">
					<a class="to-shop-btn full-sell-go-on" href="javascript:history.back();">
						<< 继续购物
					</a>
					<a class="ack-btn" onclick="closeChangeSellt();" style="cursor:pointer;">
						去结算
					</a>
				</div>
			</div>
		</div>
		<!-- 满减满赠活动变更 -->
		<div class="adjust-tooltip-box" id="changeSell" style="display:none;">
			<div class="adjust-tooltip">
				<i class="close">
				</i>
				<h4>
					亲！由于商家调整优惠活动。
				</h4>
				<h4>
					您的订单将以<span>新优惠方式</span>进行！
				</h4>
				<div class="sale-infor" id="full-sent-sale-infor" style="display:block;">
					<!--下面的JS会添加内容的-->
				</div>
				<div class="btn clearfix">
					<a class="to-shop-btn full-sell-go-on" href="javascript:history.back();" >
						<< 继续购物
					</a>
					<a class="ack-btn" onclick="closeChangeSell();" style="cursor:pointer;">
						去结算
					</a>
				</div>
			</div>
		</div>
		<!-- 七天退换货提示 -->
		<div id="layerbox-border-seven-refund" class="layerbox-border" style="display: none;">
			<div class="layerbox-content">
				<div id="layerbox-head" class="layerbox-head">
					<h3 class="layerbox-title">
						温馨提示
						<span class="layerbox-subtitle">
						</span>
						<i class="layerbox-close">
						</i>
					</h3>
				</div>
				<div class="layerbox-body">
					<p>
						您所购买的商品，商家无法提供 “<em>7天无理由退换货</em>”
					</p>
					<div class="layer-check">
						<label for="layerCheck">
							<input id="layerCheck" name="layerCheck" type="checkbox" value="1">
							请勾选,以确认您已知悉本提示</label>
					</div>
					<div class="wrong-tip" style="visibility:hidden;">
						请勾选此框，再提交订单!
					</div>
				</div>
				<div class="layerbox-foot">
					<a href="javascript:void(0)" class="layerbox-button-true">
						提交订单
					</a>
					<a href="javascript:void(0)" class="layerbox-button-false">
						取消
					</a>
				</div>
			</div>
		</div>
		<script>var isMerchantChangFullSellt = ''; // 商家在最终页提交订单~进入确认订单页期间商家改变了优惠信息
// 当用户进入提交订单页的时候
var merchantChangFullSellt = $("#merchantChangFullSellt");
if (isMerchantChangFullSellt === '1') {
	merchantChangFullSellt.show(); // 显示提示层
	$('.layerbox-overlay').show(); // 遮罩层
	setTimeout(function() {
		merchantChangFullSellt.hide();
		$('.layerbox-overlay').hide();
	}, 2000);
}
// 关闭按钮
$(".close").click(function() {
	$("#changeSell").hide();
	$("#noFullSellt").hide();
	$("#merchantChangFullSellt").hide();
	$('.layerbox-overlay').hide();
});
//  当用户在点击提交订单的时候，满赠信息不符合的时候提示
function closeChangeSell() {
	$('.layerbox-overlay').hide();
	$("#changeSell").hide();
}

function closeChangeSellt() {
	$('.layerbox-overlay').hide();
	$("#noFullSellt").hide();
}

function openChangeSell() {
	$('.layerbox-overlay').show();
	$("#changeSell").show();
}

function openChangeSellt() {
	$('.layerbox-overlay').show();
	$("#noFullSellt").show();
}</script>
		<!-- 满减满赠不在区间提示end -->
		<script>var goodsId = ''; //商品Id
var suitId = ''; //套装Id
var cartFrom = ''; //购买来源
var merchantId = '192062'; //经销商Id
var isContract = ''; //是否合约机
var goodsNumber = '';
var promoId = ''; //促销Id
var buyNowType = ''; //立即购买类型
var supportInfo = {
	"192062": 1
}; //7天退换货支持类型
$(function() {
	// 显示所有地址
	$("#addressShow").click(function() {
		$(this).addClass("none");
		$(".address-list > li,#addressHide").removeClass("none");
		$('.add-edits').addClass('none');
	});
	//支付配送覆盖离开样式
	$(".delivery-module").find("li").live({
		"mouseover": function() {
			$(this).addClass("hover").siblings().removeClass("hover");
		},
		"mouseout": function() {
			$(this).removeClass("hover");
		}
	});
	//切换支付订单
	$("input[name=merchantId]").change(function() {
		var _that = $(this);
		var merchantId = _that.val();
		var parentDiv = _that.parents("table").parent();
		//样式切换
		parentDiv.addClass("order-current").removeClass("order-other").siblings().removeClass("order-current").addClass("order-other");
		$("#orderNote").attr("name", "buyer-note-" + merchantId);
		//发票选项
		var invoice = parseInt(_that.attr("invoice"));
		if (invoice) {
			$("#order_invoice_div").show();
		} else {
			$("#order_invoice_div").hide();
		}
		//调用运费
		$.changeShipping();
	});
	// 隐藏地址
	$("#addressHide").click(function() {
		$(this).addClass("none");
		$("#addressShow").removeClass("none");
		$(".address-list > li:gt(2)").addClass("none");
	});
	$('.cancel-btn').click(function() {
		$(".delete-tooltip-box").css('display', 'none');
		$(".layerbox-overlay").css('display', 'none');
	});
	$('#zp-add-address').click(function() {
		$(this).css('background', '#fff5d6');
		//$(this).removeAttr("style");
	});
	//显示套装详情
	$(".suits").mouseover(function() {
		var suitId = $(this).attr("fn");
		$("#suit-details-" + suitId).addClass("suits-hover");
	}).mouseout(function() {
		var suitId = $(this).attr("fn");
		$("#suit-details-" + suitId).removeClass("suits-hover");
	});
	//进度条显示修改
	$('input[name=payType-' + merchantId + ']').each(function() {
		if ($(this).is(":checked")) {
			var payType = $(this).val();
			if (payType == 1) { //调整顶部进度条
				$(".s3").html("等待卖家确认");
			} else if (payType == 2) {
				$(".s3").html("去付款");
			}
		}
	});
	// 计算订单留言字数
	$("[fn='limit']").keyup(function() {
		var limit = $(this).attr('limit');
		var limitTips = $(this).attr('tipsId');
		var value = $(this).val();
		var valueLength = Math.ceil(cnlength(value) / 2);
		if (valueLength > limit) {
			$(this).val(cncut(value, limit));
			valueLength = limit;
		}
		$("#" + limitTips).text(valueLength);
	});
	//合约机姓名及身份证验证(获得焦点时，隐藏错误提示)
	$("input[name='ownerName'],input[name='ownerCard']").focus(function() {
		$(this).next("span").addClass("none");
		$.changeSubmit(1);
	});
	$("input[name='ownerName']").blur(function() {
		var ownerLength = cnlength($(this).val());
		if (ownerLength > 20 || ownerLength <= 0) { //大于20个字符，即10个汉字时提醒
			$(this).next("span").removeClass("none");
			$.changeSubmit(2);
		}
	});
	$("input[name='ownerCard']").blur(function() {
		var aCity = {
			11: "北京",
			12: "天津",
			13: "河北",
			14: "山西",
			15: "内蒙古",
			21: "辽宁",
			22: "吉林",
			23: "黑龙 江",
			31: "上海",
			32: "江苏",
			33: "浙江",
			34: "安徽",
			35: "福建",
			36: "江西",
			37: "山东",
			41: "河南",
			42: "湖 北",
			43: "湖南",
			44: "广东",
			45: "广西",
			46: "海南",
			50: "重庆",
			51: "四川",
			52: "贵州",
			53: "云南",
			54: "西 藏",
			61: "陕西",
			62: "甘肃",
			63: "青海",
			64: "宁夏",
			65: "新疆",
			71: "台湾",
			81: "香港",
			82: "澳门",
			91: "国 外"
		};
		var iSum = 0;
		var strIDno = $(this).val();
		var idCardLength = strIDno.length;
		if (!/^\d{17}(\d|x)$/i.test(strIDno) && !/^\d{15}$/i.test(strIDno)) { // 非法身份证
			$(this).next("span").html("请输入16或18位身份证号").removeClass("none");
			$.changeSubmit(2);
		}
		if (null == aCity[parseInt(strIDno.substr(0, 2))]) { // 非法地区
			$(this).next("span").html("请输入有效身份证号").removeClass("none");
			$.changeSubmit(2);
		}
	});
	//发票
	$("#invoice-editor").click(function() {
		$("#invoice-editor-div").show();
		$("#invoice-show-div").hide();
	});
	$("#invoice_cancel").click(function() {
		$("#invoice-editor-div").hide();
		$("#invoice-show-div").show();
		$.invoiceDefault(); //恢复默认
		$.invoiceInputDefault(); //选项恢复默认
	});
	$("input[name=invoiceName]").focus(function() {
		var _that = $(this);
		var thisValue = _that.val();
		if (thisValue == '姓名/公司名称') {
			_that.val('');
			_that.removeClass('text-color');
		} else {
			_that.select();
		}
	}).blur(function() {
		var _that = $(this);
		var thisValue = _that.val();
		if (thisValue == '') {
			_that.val('姓名/公司名称');
			_that.addClass('text-color');
		}
	});
	$("#save_invoice_info").click(function() {
		var invoiceType = parseInt($("input[name=invoiceType]:checked").val());
		var invoiceTypeName = invoiceType == 1 ? '普通发票' : '';
		var invoiceName = $("input[name=invoiceName]").val();
		if (invoiceName == '' || invoiceName == '姓名/公司名称') {
			$("#invoice_error").show();
			return true;
		}
		$("#is_invoice").val(invoiceType); //不需要发票
		$("#invoice_type_name").html("[" + invoiceTypeName + "]"); //发票类型名称
		$("#invoice_name_tips").html(invoiceName);
		$("#invoice-editor-div").hide();
		$("#invoice-show-div").show();
	});
	//关闭七天退换货操作
	$("#layerbox-border-seven-refund .layerbox-close, #layerbox-border-seven-refund .layerbox-button-false").click(function() {
		$("#layerbox-border-seven-refund").hide();
		$.changeSubmit(1);
	});
	//勾选确认7天退换货
	$("#layerCheck").click(function() {
		var isChecked = $(this).is(":checked");
		if (isChecked) {
			$("#layerbox-border-seven-refund .wrong-tip").css("visibility", "hidden");
		} else {
			$("#layerbox-border-seven-refund .wrong-tip").css("visibility", "visible");
		}
	});
	//确认知晓7天退换货
	$("#layerbox-border-seven-refund .layerbox-button-true").click(function() {
		var isChoosed = $("input[name=layerCheck]:checked").val();
		if (isChoosed) {
			$("#layerbox-border-seven-refund").hide();
			$("#confirmOrder").submit();
		} else {
			$("#layerbox-border-seven-refund .wrong-tip").css("visibility", "visible");
		}
	});
});</script>
		<!--页面公用函数部分-->
		<script>$(function($) {
	$.extend({
		//提交按钮切换
		changeSubmit: function(number) {
			switch (number) {
				case 1: //可提交
					$(".submit-btn").show().siblings().hide();
					break;
				case 2: //不可提交
					$(".fail-submit").show().siblings().hide();
					break;
				case 3: //提交中
					$(".submit-loading").show().siblings().hide();
					break;
			}
		},
		//发票恢复默认
		invoiceDefault: function() {
			$("#is_invoice").val(0); //不需要发票
			$("#invoice_type_name").html(""); //发票类型名称
			$("#invoice_name_tips").html("不需要发票");
		},
		//发票选项恢复默认
		invoiceInputDefault: function() {
			var _that = $("input[name=invoiceName]");
			_that.val("姓名/公司名称");
			_that.addClass("text-color");
		},
		//发票检查
		checkInvoice: function() {
			var isInvoice = parseInt($("#is_invoice").val());
			if (isInvoice == 1) {
				var invoiceName = $("input[name=invoiceName]").val();
				if (invoiceName == '' || invoiceName == '姓名/公司名称') {
					$("#invoice_err").show();
					return false;
				}
			}
			return true;
		}
	});
	//立即购买切换配送方式
	var viewTime = ((new Date()).valueOf() + "").substr(0, 10);
	//提交之前判断满赠信息是否改变
	$.extend({
		checkFullSent: function() {
			//经销商ID
			var fullMerchantId = $("input[name='merchantId']:checked").val();
			var sumPrice = ''; // 除运费外的所有价格
			if (typeof viewTime == "undefined" || sumPrice == "" || typeof fullMerchantId == "undefined") {
				return false;
			}
			//判断满赠信息是否做了修改
			var flag = 1;
			var url = "/index.php?c=Ajax_ConfirmOrder&a=CheckFullSentInfo&t=" + Math.random();
			var data = {
				merchantId: fullMerchantId,
				viewTime: viewTime,
				sumPrice: sumPrice
			};
			$.ajax({ //阻塞加载
				async: false,
				type: "POST",
				dataType: "json",
				data: data,
				url: url,
				success: function(backdata) {
					var flag = parseInt(backdata.flag);
					if (flag == 1 || flag == 2) {
						$(".full-sell-go-on").hide(); //隐藏继续购物按钮
						$(".full-sell-go-on").next("a").html("确定"); //修改为确定按钮
						$("input[name='fullMer_" + fullMerchantId + "']").val(0); //已经提示过的，放弃再次检查
						if (flag == 2) {
							$("#full-sent-sale-infor").html(backdata.infoStr); //提示信息
							openChangeSell();
						} else {
							openChangeSellt();
						}
						$.changeSubmit(1);
						flag = 0;
					}
				}
			});
			return flag;
		}
	});
	//购物车切换配送方式
	$.extend({
		changeShipping: function(options) {
			var defaults = {
				merchantId: 0,
				shippingId: 0,
				payType: 0,
				provinceId: 0,
				cityId: 0,
				addressId: 0,
				rel: 0, //1支付方式变更   2 配送方式变更
				obj: null
			}
			var options = $.extend(defaults, options);
			var merchantId = defaults.merchantId; //经销商Id
			var rel = defaults.rel;
			var obj = defaults.obj;
			var provinceId = defaults.provinceId;
			var cityId = defaults.cityId;
			//获得经销商Id
			if (!merchantId) {
				merchantId = $("input[name=merchantId]").val();
				$("input[name=merchantId]").each(function() {
					if ($(this).is(":checked")) {
						merchantId = $(this).val();
					}
				});
			}
			//支付方式Id
			var payType = defaults.payType;
			if (!payType) {
				payType = $("[name=payType-" + merchantId + "]").val();
			}
			//调整顶部进度条
			if (payType == 1) {
				$(".s3").html("等待卖家确认");
			} else if (payType == 2) {
				$(".s3").html("去付款");
			}
			//配送方式Id
			var shippingId = defaults.shippingId;
			if (!shippingId) {
				shippingId = $('[name=shipping-' + merchantId + ']').val();
			}
			//如果支付方式或收货地址改变，则配送方式归零
			if (rel == 1 || rel == 2) {
				shippingId = 0;
			}
			// 收货地址Id
			var addressId = defaults.addressId;
			if (!addressId) {
				$("input[name=addressId]").each(function() {
					if ($(this).is(":checked")) {
						addressId = $(this).val();
					}
				});
			}
			//满赠ID
			var cartIdStr = $("input[name='cart-js-" + merchantId + "']").val();
			//Ajax处理
			var url = "/index.php?c=Ajax_ConfirmOrder&a=ChangeFreightV1&callback=?&t=" + Math.random();
			$.getJSON(
				url, {
					cartIdStr: cartIdStr,
					shippingId: shippingId,
					merchantId: merchantId,
					addressId: addressId,
					payType: payType,
					shippingId: shippingId,
					provinceId: provinceId,
					cityId: cityId
				},
				function(data) {
					var payTypeInfo = null;
					if (1 == data.flag) {
						$.changeSubmit(1);
						if (data.merchantId == merchantId) {
							//价格回显
							$("#goods-total-price").html('&yen;' + data.orderTotalPrice); //商品总价
							$("#goods-freight-price").html('&yen;' + data.firstFreightPrice); //运费
							$("#total-price").html('&yen;' + data.orderAllPrice); //订单总价
							//支付方式
							var payTypeInfo = data.payTypeInfo;
							var str = '';
							var isSelect = '';
							for (var i in payTypeInfo) {
								isSelect = '';
								if (payTypeInfo[i].payId == payType) {
									isSelect = ' selected ';
								}
								str += '<option value="' + payTypeInfo[i].payId + '" ' + isSelect + '>' + payTypeInfo[i].payName + '</option>';
							}
							$("#payType-" + data.merchantId).html(str);
							//配送方式
							var shippingInfo = data.shippingInfo;
							var str = '';
							var isSelect = '';
							for (var i in shippingInfo) {
								isSelect = '';
								if (data.isCheckedShipping == shippingInfo[i].shippingId) {
									isSelect = 'selected';
								}
								str += '<option value="' + shippingInfo[i].shippingId + '" ' + isSelect + '>' + shippingInfo[i].shippingName + '：' + shippingInfo[i].price + '元</option>';
							}
							$("#shipping-" + data.merchantId).html(str);
							//到货地区
							var sendAreaStr = data.provinceName + "&nbsp;" + data.cityName + "&nbsp;&nbsp;";
							$("#sendArea-" + merchantId).html(sendAreaStr);
							//顶部导航条状态变化（只要是地址变化，均变为去付款）
							if (rel == 2) {
								$(".s3").html("去付款");
							}
						}
					} else {
						//修正订单价格及提交按钮
						$.changeSubmit(2);
						//修改运费价格和商品总价
						$("#goods-freight-price").html('请确认配送方式');
						$("#total-price").html($("#goods-total-price").html());
						alert(data.msg);
						//回显配送方式错误
						//$("#shipping-list").html('<h3>配送方式：</h3><div class="tips" style="color:#c00;">'+data.msg+'</div>');
					}
				}
			);
		}
	});
	//购物车表单提交验证
	$.extend({
		orderCartSubmit: function() {
			var submitFlag = true;
			var tips = "";
			var merchantId = 0;
			//提交按钮处理
			$.changeSubmit(3);
			$("input[name=merchantId]").each(function() {
				if ($(this).is(":checked")) {
					merchantId = $(this).val();
				}
			});
			if (!merchantId) {
				submitFlag = false;
				tips = "请选择要提交的订单";
			}
			//收货地址验证
			var addressId = 0;
			$("input[name=addressId]").each(function() {
				if ($(this).is(":checked")) {
					addressId = $(this).val();
				}
			});
			if (!addressId) {
				submitFlag = false;
				tips = "请选择收货地址";
			}
			//支付方式验证
			var payType = payType = $('#payType-' + merchantId).val();
			if (!parseInt(payType)) {
				submitFlag = false;
				tips = "请选择支付方式";
			}
			//配送方式验证
			var shippingId = $('#shipping-' + merchantId).val();
			//配送方式不存在
			if (!parseInt(shippingId)) {
				submitFlag = false;
				tips = "请选择配送方式";
			}
			//订单留言验证
			var orderContent = $("[name=buyer-note-" + merchantId + "]");
			var orderValue = orderContent.html();
			var valueLength = Math.ceil(cnlength(orderValue) / 2);
			var limit = orderContent.attr("limit");
			if (valueLength > limit) {
				submitFlag = false;
				tips = "订单留言超过字数限制";
			}
			//处理提交按钮
			if (submitFlag) {
				//检查商家是否支持七天退换货
				var supportSevenRefund = supportInfo[merchantId];
				if (!supportSevenRefund) {
					$("#layerbox-border-seven-refund").show();
				} else {
					$("#confirmOrder").submit();
				}
			} else { //处理提交按钮
				if (tips != '') {
					$.changeSubmit(1);
					$(".layerbox-overlay").show();
					$("#order-submit-box").find("p").html(tips).end().show();
					setTimeout(function() {
						$("#order-submit-box").hide();
						$(".layerbox-overlay").hide();
					}, 2000);
				} else {
					$.changeSubmit(2);
				}
			}
		}
	});
});</script>
	</body>
</html>
